/*
 * @(#)cn.design.pattern.segregation 2020/4/7/0007
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.segregation;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/7/0007
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class Segregation2 {
	public static void main(String[] args) {
		D d = new D();
		d.depend1(new C());// D类通过接口区依赖C
	}
}

interface Interface2 {
	void operation1();

	void operation2();
}

interface Interface3 {
	void operation3();

	void operation4();

	void operation5();
}

class C implements Interface2 {

	@Override
	public void operation1() {
		System.out.println("operation1");
	}

	@Override
	public void operation2() {
		System.out.println("operation2");
	}
}

class D {
	public void depend1(Interface2 i) {
		i.operation1();
	}

	public void depend2(Interface2 i) {
		i.operation2();
	}
}